package com.junjun.ssm.entity;

import lombok.Data;
import lombok.Getter;
import lombok.Setter;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import javax.persistence.Id;

@Setter
@Getter
@Document(indexName = "news_index")
public class NewsEs {

    @Field(type = FieldType.Keyword)  // FieldType.Keyword  不不做拆分
    private String id;


    @Field(type = FieldType.Text)
    private String info;

    @Field(type = FieldType.Keyword)

    private String title;

    @Field(type = FieldType.Keyword)

    private String author;

    @Field(type = FieldType.Keyword)

    private String createDate;

    @Override
    public String toString() {
        return "NewsEs{" +
                "id='" + id + '\'' +
                ", info='" + info + '\'' +
                ", title='" + title + '\'' +
                ", author='" + author + '\'' +
                ", createDate='" + createDate + '\'' +
                '}';
    }
}
